#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
const int maxn = 4e5+10;
const int mod = 1e9+7;
const int INF = 0x3f3f3f3f;
int miday[9],dt[4][2]= {1,0,-1,0,0,1,0,-1},result=46234,vis[maxn];
string path[maxn];
char op[5]="udlr";
int FAC[] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880}; 
struct node{
   string path;
   int val,pos;
};
node now,net;
int cantor(int *a){
   int x=0;
   for(int i=0;i<9;i++){
      int mi=0;
      for(int j=i+1;j<9;j++){
         if(a[j]<a[i])  mi++;
      }
      x+=FAC[9-i-1]*mi;
   }
   return x+1;
}
void decantor(int x,int *a){
   vector<int> v;
   for(int i=0;i<9;i++) v.pb(i);
   for(int i=0;i<9;i++){
      int r=x%FAC[9-i-1];
      int t=x/FAC[9-i-1];
      x=r;
      sort(v.begin(),v.end());
      a[i]=v[t];
      v.erase(v.begin()+t);
   }
}
void bfs(){
   queue<node> q;
   for(int i=0;i<8;i++) miday[i]=i+1;
   miday[8]=0;
   now.pos=8;now.val=result;now.path="";vis[result]=1;path[result]="";
   q.push(now);
   while(!q.empty()){
      now=q.front();
      q.pop();
      for(int i=0;i<4;i++){
         int dx=(now.pos)/3+dt[i][0];
         int dy=(now.pos)%3+dt[i][1];
         if(dx<0||dy<0||dx>2||dy>2) continue;
         net=now;net.pos=dx*3+dy;
         decantor(now.val-1,miday);
         swap(miday[now.pos],miday[net.pos]);
         net.val=cantor(miday);
         if(!vis[net.val]){
            vis[net.val]=1;
            net.path=op[i]+net.path;
            q.push(net);
            path[net.val]=net.path;
         }
      }
   }
   return ;
}
int main() {
   ios::sync_with_stdio(0);
   #ifdef Uncle_drew
   freopen("in.txt","r",stdin);
   freopen("out.txt","w",stdout);
   #else
   #endif
   bfs();
   char x;
   while(cin>>x){
      if(x=='x'){
         now.pos=0;
         miday[0]=0;
      }else{
         miday[0]=x-'0';
      }
      for(int i=1;i<9;i++){
         cin>>x;
         if(x=='x'){
            now.pos=i;
            miday[i]=0;
         }else{
            miday[i]=x-'0';
         }
      }
      now.val=cantor(miday);
      if(!vis[now.val]){
         cout<<"unsolvable\n";
      }else{
         cout<<path[now.val]<<endl;
      }
   }
   return 0;
}
